package com.dongan.controller;


import com.dongan.service.ManufactureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 生产派工单
 *
 * @author longTao
 * @since 2021-06-15
 */
@RestController
@RequestMapping("/manufacture")
@CrossOrigin
public class ManufactureController {

    @Autowired
    private ManufactureService service;
    /**
     * 添加生产计划
     * @param map
     * @return
     */
    /*@PostMapping("addManufacture")
    public Object addManufacture(@RequestBody Map<String,Object> map){
        //派工单编号	301+当前日期+4位流水号
        List<Apply> applies=null;
        Manufacture manufacture=null;
        ObjectMapper mapper=new ObjectMapper();
        try {
           manufacture= mapper.readValue(mapper.writeValueAsString(map.get("manufacture")),Manufacture.class);
           applies=mapper.readValue(mapper.writeValueAsString("applies"), new TypeReference<List<Apply>>() {
           });
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        String id=301+ NumberFormatUtil.numberFormat2(4, SerialNumber.manufactureSN);
        manufacture.setManufactureId(id);
        boolean flag=true;

        return new ResultResponseUtil(flag,"添加完成!");
    }*/
}

